//
//  FriendParser.h
//  FootPrint
//
//  Created by alex tao on 4/9/13.
//  Copyright (c) 2013 alex tao. All rights reserved.
//

#import "CommonParser.h"
#import "FriendQueryResponse.pb.h"
#import "GroupQueryResponse.pb.h"
#import "GroupFriendAddResponse.pb.h"
#import "GroupFriendRemoveResponse.pb.h"
#import "GroupCreateResponse.pb.h"
#import "GroupDeleteResponse.pb.h"
#import "PhoneNoCheckResponse.pb.h"
#import "PhoneNoCheckRequest.pb.h"
#import "FriendAddRequest.pb.h"
#import "FriendAddResponse.pb.h"
#import "FriendInvitationRequest.pb.h"
#import "FriendInvitationResponse.pb.h"
#import "FriendInvitationProcessRequest.pb.h"
#import "FriendInvitationProcessResponse.pb.h"
#import "PhoneNoCheckRequest.pb.h"
#import "PhoneNoCheckResponse.pb.h"
#import "FriendDeleteRequest.pb.h"
#import "FriendDeleteResponse.pb.h"

@protocol FriendDelegate <NSObject>

- (void) didRecieveFriendList:(FriendQueryResponseMessage*)friends;
- (void) didRecieveGroupList:(GroupQueryResponseMessage*)friends;
- (void) didDeleteGroup:(GroupDeleteResponseMessage*)result;

@end

@protocol GroupDelegate <NSObject>

- (void) didAddGroupFriends:(GroupFriendAddResponseMessage*)friends;
- (void) didRemoveGroupFriends:(GroupFriendRemoveResponseMessage*)friends;
- (void) didCreateGroup:(GroupCreateResponseMessage*)result;

@end


@protocol AddFriendDelegate <NSObject>

- (void)didAddByPhone:(PhoneNoCheckResponseMessage*)result;
- (void)failAddByPhone;

- (void)didAddByUid:(FriendAddResponseMessage*)result;
- (void)failAddByUid;

@end

@protocol InviteDelegate <NSObject>

- (void)didFinishInviteDelegate:(FriendInvitationResponseMessage*)result;
- (void)failInvite;

@end

@protocol HandInviteDelegate <NSObject>

- (void)didFinishHandle:(FriendInvitationProcessResponseMessage*)result;
- (void)failHandle;

@end

@protocol PhoneNoCheckDelegate <NSObject>

- (void)didFinishNoCheck:(PhoneNoCheckResponseMessage*)result;
- (void)failNoCheck;

@end

@protocol FriendDelDelegate <NSObject>

- (void)didFinishDel:(FriendDeleteResponseMessage*)result;
- (void)failDel;

@end

///////////////////////////////////////////////////////////////////////////////////////////////////


@interface FriendParser : CommonParser

@property (nonatomic, assign) id<FriendDelegate>          delegate;
@property (nonatomic, assign) id<GroupDelegate>           gDelegate;
@property (nonatomic, assign) id<AddFriendDelegate>       addDelegate;
@property (nonatomic, assign) id<InviteDelegate>          inviteDelegate;
@property (nonatomic, assign) id<HandInviteDelegate>      handleDelegate;
@property (nonatomic, assign) id<PhoneNoCheckDelegate>    phoneCheckDelegate;
@property (nonatomic, assign) id<FriendDelDelegate>       friendDelDelegate;

- (void) updateFriendListForUid:(long long)uid;

- (void) updateGroupListForUid:(long long)uid;
- (void) addGroupMember:(long long)gId withMemberList:(NSArray*)ids;
- (void) removeGroupMember:(long long)gId withMemberList:(NSArray*)ids;
- (void) createGroup:(long long)uid forName:(NSString*)name withMembers:(NSArray*)userMsgs;
- (void) deleteGroup:(long long)uid forGroupId:(long long)gid;

- (void)addFriendByPhone:(NSString*)phoneNum;
- (void)addFriendByUid:(long long)uid myId:(long long)myId;
- (void)addFriendByUids:(NSArray*)uids myId:(long long)myId;
- (void)delFriendByUid:(long long)uid myId:(long long)myId;

- (void)inviteRequest:(long long)userId;

- (void)handInvite:(long long)userId inviteUserId:(long long)invId state:(int)state;
- (void)phoneNumCheck:(NSArray*)arrNum;


@end
